import Vue from 'vue'
import VueRouter from 'vue-router'
import AddTeacher from "../views/AddTeacher";
import AddCourse from "../views/AddCourse";
import EditCourse from "../views/EditCourse";
import EditTeacher from "../views/EditTeacher";
import FindAmount from "../views/FindAmount";
import FindMoney from "../views/FindMoney";
import FindStudent from "../views/FindStudent";
import UpdateCourse from "../views/UpdateCourse";
import UpdateTeacher from "../views/UpdateTeacher";
import Index from "../views/Index";
import Login from "../views/Login";

import MyCourse from "../views/MyCourse";
import Student from "../views/Student";
import ChooseCourse from "../views/ChooseCourse";
import Pay from "../views/Pay";
import FindTeacher from "../views/FindTeacher";
import FindCourse from "../views/FindCourse";
import DeleteTeacher from "../views/DeleteTeacher";
import DeleteCourse from "../views/DeleteCourse";
import ShowCourse from "../views/ShowCourse";

Vue.use(VueRouter)

export const startLogin = [
  {
    path : '/',
    name : '登录',
    component : Login,
  }
]

export const adminLogin = [
  {
    path : '/Add',
    name : '添加',
    component : Index,
    redirect : "/AddTeacher",
    children : [
      {
        path : '/AddTeacher',
        name : '添加教师信息',
        component : AddTeacher,
      },
      {
        path : '/AddCourse',
        name : '添加课程信息',
        component : AddCourse,
      }
    ]
  },
  {
    path: '/delete',
    name : '删除',
    component: Index,
    children: [
      {
        path : '/DeleteTeacher',
        name : '删除教师信息',
        component: DeleteTeacher,
      },
      {
        path: '/DeleteCourse',
        name : '删除课程信息',
        component: DeleteCourse,
      }
    ]
  },
  {
    path: '/find',
    name : '查询',
    component: Index,
    children: [
      {
        path: '/FindAmount',
        name : '查询账目信息',
        component: FindAmount,
      },
      {
        path: '/FindStudent',
        name:'查询学生信息',
        component: FindStudent,
      },
      {
        path:'/FindMoney',
        name:'查询催费信息',
        component: FindMoney,
      },
      {
        path:'/FindTeacher',
        name:'查询教师信息',
        component: FindTeacher,
      },
      {
        path:'/FindCourse',
        name:'查询课程信息',
        component: FindCourse,
      }
    ]
  },
  {
    path: '/update',
    name:'更新',
    component: Index,
    children: [
      {
        path: '/UpdateTeacher',
        name:'更新教师信息',
        component: UpdateTeacher,
      },
      {
        path: '/UpdateCourse',
        name:'更新课程信息',
        component: UpdateCourse,
      }
    ]
  }
]

export const studentLogin = [
  {
    path : '/Find',
    name : '查询',
    component : Student,
    redirect:'/MyCourse',
    children : [
      {
        path : '/MyCourse',
        name : '我的课表',
        component : MyCourse,
      }
    ]
  },
  {
    path: '/choose',
    name: '选择课程',
    component: Student,
    children: [
      {
        path: '/ShowCourse',
        name:'查询课程',
        component: ShowCourse,
      },
      {
        path: '/ChooseCourse',
        name: '选择课程',
        component: ChooseCourse,
      }
    ]
  },
  {
    path: '/pay',
    name:'自助缴费',
    component: Student,
    children: [
      {
        path: '/Pay',
        name: '课程缴费',
        component: Pay,
      }
    ]
  }
]



const router = new VueRouter({
  mode: 'hash',
  routes :startLogin
})

export default router

// export default new Router({
//   routes: [
//     {
//       path: '/',//自定义你的页面路径
//       name: '登录',//起个名字
//       component: Login//引用的组件名
//     },
//     {
//       path: '/login',//登录页面，同上
//       name: '登录',
//       component: Login//使用登录组件
//     },
//     {
//       path: '/Student',//
//       name: '选择课程',
//       component: Student,
//       children : [
//         {
//           path : '/StudentChoose',
//           name : '学生选择课程',
//           component : StudentChoose,
//         }
//       ]
//     },
//   ]
// })
